package com.zhsource.system.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>@ClassName：User
 * <p>@Date 2023/10/17  10:17
 *
 * @Author zzl
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Menu {
    private Long id;
    private String name;
    private String component;
    private String url;
    private String icon;
    private Integer index;
    private Long parentId;

    // 上级菜单对象
    private Menu parent;

    // 下级菜单集合
    // 此注解的意思是当集合没有数据的时候不响应
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Menu> children = new ArrayList<>();
}


